//
//  AddArticleTitileCell.m
//  MIDI
//
//  Created by 邵子凡 on 15/10/29.
//  Copyright © 2015年 QXSX. All rights reserved.
//

#import "AddArticleTitileCell.h"

@interface AddArticleTitileCell ()<UITextFieldDelegate>

@property (weak, nonatomic) IBOutlet UITextField *titleField;
@end

@implementation AddArticleTitileCell

+(instancetype)cellWithTableView:(UITableView *)tableView{
    
    static NSString *ID = @"AddArticleTitileCell";
    AddArticleTitileCell  *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle]loadNibNamed:@"AddArticleTitileCell" owner:nil options:nil]firstObject] ;
        
    }
    
    [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    
    return cell;
}

- (void)awakeFromNib {
    
    self.titleField.delegate = self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)textFieldDidEndEditing:(UITextField *)textField{
    
    if ([self.delegate respondsToSelector:@selector(upLoadTitle:)]) {
        [self.delegate upLoadTitle:textField.text];
    }
}

@end
